﻿<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="VinidiktovDay5Model" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
  <EntityType Name="CategoryProduct">
    <Key>
      <PropertyRef Name="ID_Category" />
    </Key>
    <Property Name="ID_Category" Type="Int32" Nullable="false" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Product" Relationship="Self.FK_Product_CategoryProduct" FromRole="CategoryProduct" ToRole="Product" />
  </EntityType>
  <EntityType Name="ManufactureProduct">
    <Key>
      <PropertyRef Name="ID_Manufacturer" />
    </Key>
    <Property Name="ID_Manufacturer" Type="Int32" Nullable="false" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Product" Relationship="Self.FK_Product_ManufactureProduct" FromRole="ManufactureProduct" ToRole="Product" />
  </EntityType>
  <EntityType Name="Order">
    <Key>
      <PropertyRef Name="ID_Order" />
    </Key>
    <Property Name="ID_Order" Type="Int32" Nullable="false" />
    <Property Name="ID_StatusOrder" Type="Int32" Nullable="false" />
    <Property Name="DateOrder" Type="DateTime" Nullable="false" Precision="0" />
    <Property Name="DateDelivery" Type="DateTime" Nullable="false" Precision="0" />
    <Property Name="ID_CompositionOrder" Type="Int32" Nullable="false" />
    <Property Name="CountProduct" Type="Int32" Nullable="false" />
    <Property Name="ID_PickUp" Type="Int32" Nullable="false" />
    <Property Name="ID_Client" Type="Int32" />
    <Property Name="CodeReceive" Type="Int32" Nullable="false" />
    <NavigationProperty Name="PickUpPoint" Relationship="Self.FK_Order_PickUpPoint" FromRole="Order" ToRole="PickUpPoint" />
    <NavigationProperty Name="StatusOrder" Relationship="Self.FK_Order_StatusOrder" FromRole="Order" ToRole="StatusOrder" />
    <NavigationProperty Name="Users" Relationship="Self.FK_Order_Users" FromRole="Order" ToRole="Users" />
    <NavigationProperty Name="OrderProduct" Relationship="Self.FK_OrderProduct_Order" FromRole="Order" ToRole="OrderProduct" />
  </EntityType>
  <EntityType Name="OrderProduct">
    <Key>
      <PropertyRef Name="ID_OrderProduct" />
    </Key>
    <Property Name="ID_OrderProduct" Type="Int32" Nullable="false" />
    <Property Name="ID_Order" Type="Int32" />
    <Property Name="ID_Product" Type="Int32" Nullable="false" />
    <NavigationProperty Name="Order" Relationship="Self.FK_OrderProduct_Order" FromRole="OrderProduct" ToRole="Order" />
    <NavigationProperty Name="Product" Relationship="Self.FK_OrderProduct_Product" FromRole="OrderProduct" ToRole="Product" />
  </EntityType>
  <EntityType Name="PickUpPoint">
    <Key>
      <PropertyRef Name="ID_PickUp" />
    </Key>
    <Property Name="ID_PickUp" Type="Int32" Nullable="false" />
    <Property Name="Address" Type="String" MaxLength="300" FixedLength="false" Unicode="true" />
    <NavigationProperty Name="Order" Relationship="Self.FK_Order_PickUpPoint" FromRole="PickUpPoint" ToRole="Order" />
  </EntityType>
  <EntityType Name="Product">
    <Key>
      <PropertyRef Name="ID_Product" />
    </Key>
    <Property Name="ID_Product" Type="Int32" Nullable="false" />
    <Property Name="Articul" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="DescriptionProduct" Type="String" MaxLength="200" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="ID_Category" Type="Int32" Nullable="false" />
    <Property Name="Photo" Type="String" MaxLength="1000" FixedLength="false" Unicode="true" />
    <Property Name="ID_Manufacture" Type="Int32" Nullable="false" />
    <Property Name="Cost" Type="Int32" Nullable="false" />
    <Property Name="CurrentDiscount" Type="Int32" Nullable="false" />
    <Property Name="MaxDiscount" Type="Int32" Nullable="false" />
    <Property Name="QuantityStock" Type="Int32" Nullable="false" />
    <Property Name="ID_UnitMeasurement" Type="Int32" Nullable="false" />
    <Property Name="ID_Supplier" Type="Int32" Nullable="false" />
    <NavigationProperty Name="CategoryProduct" Relationship="Self.FK_Product_CategoryProduct" FromRole="Product" ToRole="CategoryProduct" />
    <NavigationProperty Name="ManufactureProduct" Relationship="Self.FK_Product_ManufactureProduct" FromRole="Product" ToRole="ManufactureProduct" />
    <NavigationProperty Name="OrderProduct" Relationship="Self.FK_OrderProduct_Product" FromRole="Product" ToRole="OrderProduct" />
    <NavigationProperty Name="Supplier" Relationship="Self.FK_Product_Supplier" FromRole="Product" ToRole="Supplier" />
    <NavigationProperty Name="UnitMeasurement" Relationship="Self.FK_Product_UnitMeasurement" FromRole="Product" ToRole="UnitMeasurement" />
  </EntityType>
  <EntityType Name="Role">
    <Key>
      <PropertyRef Name="ID_Role" />
    </Key>
    <Property Name="ID_Role" Type="Int32" Nullable="false" />
    <Property Name="Role1" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Users" Relationship="Self.FK_Users_Role" FromRole="Role" ToRole="Users" />
  </EntityType>
  <EntityType Name="StatusOrder">
    <Key>
      <PropertyRef Name="ID_Status" />
    </Key>
    <Property Name="ID_Status" Type="Int32" Nullable="false" />
    <Property Name="Status" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Order" Relationship="Self.FK_Order_StatusOrder" FromRole="StatusOrder" ToRole="Order" />
  </EntityType>
  <EntityType Name="Supplier">
    <Key>
      <PropertyRef Name="ID_Supplier" />
    </Key>
    <Property Name="ID_Supplier" Type="Int32" Nullable="false" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Product" Relationship="Self.FK_Product_Supplier" FromRole="Supplier" ToRole="Product" />
  </EntityType>
  <EntityType Name="UnitMeasurement">
    <Key>
      <PropertyRef Name="ID_UnitMeasurement" />
    </Key>
    <Property Name="ID_UnitMeasurement" Type="Int32" Nullable="false" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Product" Relationship="Self.FK_Product_UnitMeasurement" FromRole="UnitMeasurement" ToRole="Product" />
  </EntityType>
  <EntityType Name="Users">
    <Key>
      <PropertyRef Name="ID_User" />
    </Key>
    <Property Name="ID_User" Type="Int32" Nullable="false" />
    <Property Name="FIO" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="Login" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="Password" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="ID_Role" Type="Int32" Nullable="false" />
    <NavigationProperty Name="Order" Relationship="Self.FK_Order_Users" FromRole="Users" ToRole="Order" />
    <NavigationProperty Name="Role" Relationship="Self.FK_Users_Role" FromRole="Users" ToRole="Role" />
  </EntityType>
  <EntityType Name="InfoProduct">
    <Key>
      <PropertyRef Name="ID_Product" />
      <PropertyRef Name="Name" />
      <PropertyRef Name="DescriptionProduct" />
      <PropertyRef Name="Manufacture" />
      <PropertyRef Name="Cost" />
      <PropertyRef Name="QuantityStock" />
    </Key>
    <Property Name="ID_Product" Type="Int32" Nullable="false" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="DescriptionProduct" Type="String" MaxLength="200" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="Manufacture" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="Cost" Type="Int32" Nullable="false" />
    <Property Name="QuantityStock" Type="Int32" Nullable="false" />
    <Property Name="Photo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
  </EntityType>
  <Association Name="FK_Product_CategoryProduct">
    <End Role="CategoryProduct" Type="Self.CategoryProduct" Multiplicity="1" />
    <End Role="Product" Type="Self.Product" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="CategoryProduct">
        <PropertyRef Name="ID_Category" />
      </Principal>
      <Dependent Role="Product">
        <PropertyRef Name="ID_Category" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Product_ManufactureProduct">
    <End Role="ManufactureProduct" Type="Self.ManufactureProduct" Multiplicity="1" />
    <End Role="Product" Type="Self.Product" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="ManufactureProduct">
        <PropertyRef Name="ID_Manufacturer" />
      </Principal>
      <Dependent Role="Product">
        <PropertyRef Name="ID_Manufacture" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_PickUpPoint">
    <End Role="PickUpPoint" Type="Self.PickUpPoint" Multiplicity="1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="PickUpPoint">
        <PropertyRef Name="ID_PickUp" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="ID_PickUp" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_StatusOrder">
    <End Role="StatusOrder" Type="Self.StatusOrder" Multiplicity="1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="StatusOrder">
        <PropertyRef Name="ID_Status" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="ID_StatusOrder" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_Users">
    <End Role="Users" Type="Self.Users" Multiplicity="0..1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Users">
        <PropertyRef Name="ID_User" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="ID_Client" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_OrderProduct_Order">
    <End Role="Order" Type="Self.Order" Multiplicity="0..1" />
    <End Role="OrderProduct" Type="Self.OrderProduct" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Order">
        <PropertyRef Name="ID_Order" />
      </Principal>
      <Dependent Role="OrderProduct">
        <PropertyRef Name="ID_Order" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_OrderProduct_Product">
    <End Role="Product" Type="Self.Product" Multiplicity="1" />
    <End Role="OrderProduct" Type="Self.OrderProduct" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Product">
        <PropertyRef Name="ID_Product" />
      </Principal>
      <Dependent Role="OrderProduct">
        <PropertyRef Name="ID_Product" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Product_Supplier">
    <End Role="Supplier" Type="Self.Supplier" Multiplicity="1" />
    <End Role="Product" Type="Self.Product" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Supplier">
        <PropertyRef Name="ID_Supplier" />
      </Principal>
      <Dependent Role="Product">
        <PropertyRef Name="ID_Supplier" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Product_UnitMeasurement">
    <End Role="UnitMeasurement" Type="Self.UnitMeasurement" Multiplicity="1" />
    <End Role="Product" Type="Self.Product" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="UnitMeasurement">
        <PropertyRef Name="ID_UnitMeasurement" />
      </Principal>
      <Dependent Role="Product">
        <PropertyRef Name="ID_UnitMeasurement" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Users_Role">
    <End Role="Role" Type="Self.Role" Multiplicity="1" />
    <End Role="Users" Type="Self.Users" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Role">
        <PropertyRef Name="ID_Role" />
      </Principal>
      <Dependent Role="Users">
        <PropertyRef Name="ID_Role" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <EntityContainer Name="VinidiktovDay5Entities" annotation:LazyLoadingEnabled="true">
    <EntitySet Name="CategoryProduct" EntityType="Self.CategoryProduct" />
    <EntitySet Name="ManufactureProduct" EntityType="Self.ManufactureProduct" />
    <EntitySet Name="Order" EntityType="Self.Order" />
    <EntitySet Name="OrderProduct" EntityType="Self.OrderProduct" />
    <EntitySet Name="PickUpPoint" EntityType="Self.PickUpPoint" />
    <EntitySet Name="Product" EntityType="Self.Product" />
    <EntitySet Name="Role" EntityType="Self.Role" />
    <EntitySet Name="StatusOrder" EntityType="Self.StatusOrder" />
    <EntitySet Name="Supplier" EntityType="Self.Supplier" />
    <EntitySet Name="UnitMeasurement" EntityType="Self.UnitMeasurement" />
    <EntitySet Name="Users" EntityType="Self.Users" />
    <EntitySet Name="InfoProduct" EntityType="Self.InfoProduct" />
    <AssociationSet Name="FK_Product_CategoryProduct" Association="Self.FK_Product_CategoryProduct">
      <End Role="CategoryProduct" EntitySet="CategoryProduct" />
      <End Role="Product" EntitySet="Product" />
    </AssociationSet>
    <AssociationSet Name="FK_Product_ManufactureProduct" Association="Self.FK_Product_ManufactureProduct">
      <End Role="ManufactureProduct" EntitySet="ManufactureProduct" />
      <End Role="Product" EntitySet="Product" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_PickUpPoint" Association="Self.FK_Order_PickUpPoint">
      <End Role="PickUpPoint" EntitySet="PickUpPoint" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_StatusOrder" Association="Self.FK_Order_StatusOrder">
      <End Role="StatusOrder" EntitySet="StatusOrder" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_Users" Association="Self.FK_Order_Users">
      <End Role="Users" EntitySet="Users" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK_OrderProduct_Order" Association="Self.FK_OrderProduct_Order">
      <End Role="Order" EntitySet="Order" />
      <End Role="OrderProduct" EntitySet="OrderProduct" />
    </AssociationSet>
    <AssociationSet Name="FK_OrderProduct_Product" Association="Self.FK_OrderProduct_Product">
      <End Role="Product" EntitySet="Product" />
      <End Role="OrderProduct" EntitySet="OrderProduct" />
    </AssociationSet>
    <AssociationSet Name="FK_Product_Supplier" Association="Self.FK_Product_Supplier">
      <End Role="Supplier" EntitySet="Supplier" />
      <End Role="Product" EntitySet="Product" />
    </AssociationSet>
    <AssociationSet Name="FK_Product_UnitMeasurement" Association="Self.FK_Product_UnitMeasurement">
      <End Role="UnitMeasurement" EntitySet="UnitMeasurement" />
      <End Role="Product" EntitySet="Product" />
    </AssociationSet>
    <AssociationSet Name="FK_Users_Role" Association="Self.FK_Users_Role">
      <End Role="Role" EntitySet="Role" />
      <End Role="Users" EntitySet="Users" />
    </AssociationSet>
  </EntityContainer>
</Schema>